<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>采购单产品明细视图</title>
</head>
<body class="easyui-layout">
<script>
    $(function () {
        $("tboby tr").addClass("datagrid-row");
        $("#showPurchase-form").form({
            onLoadSuccess: function () {
                $("#hut-purid-show").next().hide();
            }
        });

        $("#pdg-add-show").datagrid({
            onBeforeLoad:function () {
                var queryParams = $("#pdg-add-show").datagrid('options').queryParams;
                queryParams.purid = $("#purdg").datagrid("getSelected").purid;
            }
        });

        $("#showPur-close").linkbutton({onClick:function () {
                var row = $("#purdg").datagrid("getSelected");
                $("#detilsPur"+row.purid).dialog("close");
            }});

    });
    function formatImg(value,row,index){
        return '<a href="to-proImgZoomIn?value='+value+'\" target="_blank"><img  title=\"点击查看高清图\" alt=\"图片暂时无法显示\"  src=\"'+'productionsphotosZoomOut\\'+value+'\"/></a>';
    }
    function formatC(value,row,index) {
        if(value==""||value==null){
            return'<span style="font-size:12px;color:red;">暂无分类</span>';
        }else {
            return value;
        }
    }
    function formatM(value,row,index){
        if(value!=null){
            return "￥"+value;
        }else{
            return value;
        }
    }
</script>
<div data-options="region:'north'" style="height:280px;">
<form id="showPurchase-form" action="" method="">

    <div class="div-title-hut"> --------------------------------<span class="span-title">采购单基本信息</span>---------------------------</div>
    <div class="ddt">
        <input id="hut-purid-show" name="purid" class="easyui-textbox" data-options="border:false"/>
        <input name="purtheme" class="easyui-textbox" data-options="label:'采购主题',required:true,border:false,readonly:true,width:300"><div style="display: inline-block;margin-left: 5%;"></div>
        <input name="clientname" class="easyui-textbox" data-options="required:true,
                label:'供应商(客户)',width:300,readonly:true,border:false">
    </div>
    <div class="ddt">
        <input  name="contactName" class="easyui-textbox" data-options="required:false,readonly:true,border:false,
                label:'供应商联系人',width:300" ><div style="display: inline-block;margin-left: 5%;"></div>
        <input  class="easyui-textbox" name="purUsername" style="width:300px;"
                data-options="
                    label:'经手人',
                    required:true,border:false,readonly:true"/>
    </div>
    <div class="ddt">
        <input id="purdate-show" name="purdate" class="easyui-textbox" data-options="label:'采购日期',required:true,border:false,readonly:true,width:300"><div style="display: inline-block;margin-left: 5%;"></div>
        <input id="purexcepttime-show" name="purexcepttime" class="easyui-textbox" data-options="label:'预计到货日期',required:false,border:false,readonly:true,width:300">
    </div>
    <div class="ddt">
        <span>备注:</span><br>
        <input id="remarks-show" name="remarks" class="easyui-textbox" data-options="required:false,width:650,height:45,multiline:true,readonly:true,border:false">
    </div>
</form>
</div>
    <div data-options="region:'center'" style="height: 200px;">
    <table id="pdg-add-show" class="easyui-datagrid table-chance" data-options="fit:true,striped:true,fitColumns:true,checkOnSelect:true,
           autoRowHeight:true,nowrap:false,pagination:true,
        pageList:[5,10,15,20],pageSize:5,scrollbarSize:0,url:'allppd',method:'post'">
        <thead>
        <tr class="datagrid-header-row">
            <th data-options="field:'code',width:5,align:'center',checkbox:true">编码</th>
            <th data-options="field:'ppdid',width:5,align:'center',hidden:true">采购详情ID</th>
            <th data-options="field:'proid',width:5,align:'center'">产品ID</th>
            <th data-options="field:'pidfk',width:5,align:'center',hidden:true">采购单id</th>
            <th data-options="field:'pname',width:15,align:'center'">产品名称</th>
            <th data-options="field:'pimg',width:10,align:'center'" formatter="formatImg">产品图片</th>
            <th data-options="field:'ppmoney',width:10,align:'center'" formatter="formatM">产品采购单价</th>
            <th data-options="field:'ppcount',width:10,align:'center'" formatter="formatM">产品采购价格</th>
            <th data-options="field:'ppcost',width:10,align:'center'" formatter="formatM">产品采购总价</th>
            <th data-options="field:'pCategoryname',width:15,align:'center'" formatter="formatC">产品分类名</th>
            <th data-options="field:'pcompany',width:20,align:'center'">生产厂家</th>
        </tr>
        </thead>
        <tbody>
        </tbody>
    </table>
    </div>
<div class="btn" style="text-align:center;margin-top:50px;">
    <a id="showPur-close" class="easyui-linkbutton" data-options="iconCls:'icon-cancel2'">关闭</a>
</div>
</body>
</html>
